<!DOCTYPE html>
<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
  <link rel="stylesheet" href="/resources/css/pintuer.css">
  <link rel="stylesheet" href="/resources/css/admin.css">
  <script src="/resources/js/jquery.js"></script>
  <script src="/resources/js/pintuer.js"></script>
</head>
<body>
<div class="panel admin-panel margin-top">
  <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>添加内容</strong></div>
  <div class="body-content">
    <form method="post" class="form-x" action="/attachment/add" enctype="multipart/form-data">
      <div class="form-group">
        <div class="label">
          <label>文件标签：</label>
        </div>
        <div class="button-group border-main checkbox">
         <label class="button active">
                    <input name="fileMark" value="逗逼" type="checkbox" checked="checked">逗逼
					</label>
					<label class="button">
						<input name="fileMark" value="搞笑" type="checkbox">搞笑
					</label>
					<label class="button">
						<input name="fileMark" value="严肃" type="checkbox">严肃
					</label>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>所属文件夹：</label>
        </div>
        <div class="field">
          <select name="folderId" class="input w80" style="line-height:17px;">
              <option th:each="folder:${folderList}" th:value="${folder.folderId}" th:text="${folder.folderName}">我的回忆</option>
            </select>
        </div>
      </div> 
      <div class="form-group">
        <div class="label">
          <label>选择文件：</label>
        </div>
        <div class="field">
        	<button class="button bg-main icon-check-square-o" id="addFile" type="button"> 添加一行</button>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
        </div>
        <div class="field" id="myfile">
         	<div><a class="button input-file bg-green" href="javascript:void(0);">+ 浏览文件<input size="100" type="file" name="mf" /></a>
         <a class="button input-file bg-red" href="javascript:void(0);" onclick="del(this)"> 删除</a>
         </div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
        </div>
      </div>
    </form>
  </div>
</div>
<script type="text/javascript">
		$("#addFile").click(function(){
			var html='<div><a class="button input-file bg-green" href="javascript:void(0);">+ 浏览文件<input size="100" type="file" name="mf" /></a> <a class="button input-file bg-red" onclick="del(this)"> 删除</a><div>'
			$("#myfile").append(html);
		});
		function del(obj){
			obj.parentElement.remove();
		}
</script>
</body>
</html>